package com.company.project.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 用户
 *
 * @author ZhangYu
 * @version V1.0
 * @date 2020年12月12日
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class SysUser extends BaseEntity implements Serializable {
    @TableId
    private String id;

    @NotBlank(message = "账号不能为空")
    @ApiModelProperty("账号")
    private String username;

    @ApiModelProperty("盐")
    private String salt;

    @NotBlank(message = "密码不能为空")
    @ApiModelProperty("密码")
    private String password;

    @ApiModelProperty("旧密码")
    @TableField(exist = false)
    private String oldPwd;

    @ApiModelProperty("新密码")
    @TableField(exist = false)
    private String newPwd;

    @ApiModelProperty("电话")
    private String phone;

    @ApiModelProperty("所属机构名称")
    @TableField(exist = false)
    private String deptName;

    @TableField(exist = false)
    private String deptNo;

    @ApiModelProperty("真实姓名")
    private String realName;

    @ApiModelProperty("昵称")
    private String nickName;

    @ApiModelProperty("邮箱")
    private String email;

    @ApiModelProperty("账户状态(1.正常 2.锁定 )")
    private Integer status;

    @ApiModelProperty("年龄")
    private Integer sex;

    @ApiModelProperty("逻辑删除")
    @TableField(fill = FieldFill.INSERT)
    private Integer deleted;

    @ApiModelProperty("创建人id")
    private String createId;

    @ApiModelProperty("修改人id")
    private String updateId;

    @ApiModelProperty("创建来源")
    private Integer createWhere;

    @ApiModelProperty("创建时间")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty("更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @ApiModelProperty("开始时间")
    @TableField(exist = false)
    private String startTime;

    @ApiModelProperty("结束时间")
    @TableField(exist = false)
    private String endTime;

    @ApiModelProperty("角色id")
    @TableField(exist = false)
    private List<String> roleIds;

    @ApiModelProperty("账号")
    @TableField(exist = false)
    private String Captcha;
}